<!DOCTYPE html>

<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width">
	<title>Documentation Class: Chatroom</title>

	<!--[if lt IE 9]>
	<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
	<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">

	<link type="text/css" rel="stylesheet" href="styles/site.simplex.css">

</head>

<body>

<div class="navbar navbar-default navbar-fixed-top ">
<div class="container">
	<div class="navbar-header">
		<a class="navbar-brand" href="index.html">Documentation</a>
		<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
        </button>
	</div>
	<div class="navbar-collapse collapse" id="topNavigation">
		<ul class="nav navbar-nav">
			
			<li class="dropdown">
				<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a>
				<ul class="dropdown-menu ">
					<li><a href="blob.html">blob</a></li><li><a href="support.html">support</a></li><li><a href="global.html#util">util</a></li>
				</ul>
			</li>
			
			<li class="dropdown">
				<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
				<ul class="dropdown-menu ">
					<li><a href="Audio.html">Audio</a></li><li><a href="Chatroom.html">Chatroom</a></li><li><a href="ChatroomInfo.html">ChatroomInfo</a></li><li><a href="ChatroomMember.html">ChatroomMember</a></li><li><a href="ChatroomMessage.html">ChatroomMessage</a></li><li><a href="Collect.html">Collect</a></li><li><a href="Comment.html">Comment</a></li><li><a href="File.html">File</a></li><li><a href="Friend.html">Friend</a></li><li><a href="Geo.html">Geo</a></li><li><a href="Image.html">Image</a></li><li><a href="IMMessage.html">IMMessage</a></li><li><a href="LoginPort.html">LoginPort</a></li><li><a href="Netcall.html">Netcall</a></li><li><a href="NetcallWeixin.html">NetcallWeixin</a></li><li><a href="NIM.html">NIM</a></li><li><a href="NIMError.html">NIMError</a></li><li><a href="NRTC.html">NRTC</a></li><li><a href="Relation.html">Relation</a></li><li><a href="Session.html">Session</a></li><li><a href="Signaling.html">Signaling</a></li><li><a href="SuperTeam.html">SuperTeam</a></li><li><a href="SuperTeamMember.html">SuperTeamMember</a></li><li><a href="SystemMessage.html">SystemMessage</a></li><li><a href="Team.html">Team</a></li><li><a href="TeamMember.html">TeamMember</a></li><li><a href="User.html">User</a></li><li><a href="Video.html">Video</a></li><li><a href="WebRTC.html">WebRTC</a></li><li><a href="WebRTC_NRTC.html">WebRTC/NRTC</a></li><li><a href="WhiteBoard.html">WhiteBoard</a></li>
				</ul>
			</li>
			
			<li class="dropdown">
				<a href="events.list.html" class="dropdown-toggle" data-toggle="dropdown">Events<b class="caret"></b></a>
				<ul class="dropdown-menu ">
					<li><a href="NRTC.html#event:addTrack">NRTC#event:addTrack</a></li><li><a href="NRTC.html#event:audioVolume">NRTC#event:audioVolume</a></li><li><a href="NRTC.html#event:auidoMixingEnd">NRTC#event:auidoMixingEnd</a></li><li><a href="NRTC.html#event:deviceAdd">NRTC#event:deviceAdd</a></li><li><a href="NRTC.html#event:deviceRemove">NRTC#event:deviceRemove</a></li><li><a href="NRTC.html#event:deviceStatus">NRTC#event:deviceStatus</a></li><li><a href="NRTC.html#event:error">NRTC#event:error</a></li><li><a href="NRTC.html#event:gatewayClosed">NRTC#event:gatewayClosed</a></li><li><a href="NRTC.html#event:joinChannel">NRTC#event:joinChannel</a></li><li><a href="NRTC.html#event:leaveChannel">NRTC#event:leaveChannel</a></li><li><a href="NRTC.html#event:recordStopped">NRTC#event:recordStopped</a></li><li><a href="NRTC.html#event:remoteTrack">NRTC#event:remoteTrack</a></li><li><a href="NRTC.html#event:removeTrack">NRTC#event:removeTrack</a></li><li><a href="NRTC.html#event:streamEnded">NRTC#event:streamEnded</a></li><li><a href="NRTC.html#event:userJoined">NRTC#event:userJoined</a></li><li><a href="NRTC.html#event:userLeft">NRTC#event:userLeft</a></li><li><a href="NRTC.html#event:userStateUpdated">NRTC#event:userStateUpdated</a></li><li><a href="WebRTC.html#event:beCalling">WebRTC#event:beCalling</a></li><li><a href="WebRTC.html#event:callAccepted">WebRTC#event:callAccepted</a></li><li><a href="WebRTC.html#event:callerAckSync">WebRTC#event:callerAckSync</a></li><li><a href="WebRTC.html#event:callRejected">WebRTC#event:callRejected</a></li><li><a href="WebRTC.html#event:control">WebRTC#event:control</a></li><li><a href="WebRTC.html#event:hangup">WebRTC#event:hangup</a></li><li><a href="WebRTC.html#event:sessionDuration">WebRTC#event:sessionDuration</a></li>
				</ul>
			</li>
			
			<li class="dropdown">
				<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
				<ul class="dropdown-menu ">
					<li><a href="global.html#changeRoleToAudience">changeRoleToAudience</a></li><li><a href="global.html#changeRoleToPlayer">changeRoleToPlayer</a></li><li><a href="global.html#createProgram">createProgram</a></li><li><a href="global.html#filterClientAntispam">filterClientAntispam</a></li><li><a href="global.html#loadShader">loadShader</a></li><li><a href="global.html#obj">obj</a></li><li><a href="global.html#RTC_EVENTS">RTC_EVENTS</a></li>
				</ul>
			</li>
			
		</ul>
        
            <div class="col-sm-3 col-md-3">
                <form class="navbar-form" role="search">
                    <div class="input-group">
                        <input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
                        <div class="input-group-btn">
                            <button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
                        </div>
                    </div>
                </form>
            </div>
        
	</div>

</div>
</div>


<div class="container" id="toc-content">
<div class="row">

	
	<div class="col-md-8">
	
		<div id="main">
			

	<h1 class="page-title">Class: Chatroom</h1>
<section>

<header>
    
        <h2>
        Chatroom
        </h2>
        
    
</header>


<article>
    <div class="container-overview">
    
        
<hr>
<dt>
    <h4 class="name" id="Chatroom"><span class="type-signature"></span>new Chatroom()</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>请使用 <a href="Chatroom.html#.getInstance"><code>Chatroom.getInstance</code></a> 来初始化聊天室.<br>此接口为单例模式, 对于同一个账号的同一个聊天室, 永远返回同一份实例, 即只有第一次调用会初始化一个实例, 后续调用此接口会直接返回初始化过的实例.</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

    
    </div>

    

    

    

    

    

    

    
        <h3 class="subsection-title">Methods</h3>

        <dl>
            
<hr>
<dt>
    <h4 class="name" id=".getInstance"><span class="type-signature">&lt;static> </span>getInstance(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <ul>
<li>此接口为单例模式, 对于同一个账号, 永远返回同一份实例, 即只有第一次调用会初始化一个实例</li>
<li>后续调用此接口会直接返回初始化过的实例, 同时也会调用接口<a href="Chatroom.html#setOptions"><code>setOptions</code></a>更新传入的配置</li>
<li>后续调用此接口时, 如果连接已断开, 会自动建立连接</li>
<li>当发生掉线时，SDK会自动进行重连</li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>secure</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>
|

<span class="param-type">Object</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description last"><p>secure 模式下会通过 https 协议跟服务器建立连接, 非 secure 模式下会通过 http 协议跟服务器建立连接, 默认 true</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>appKey</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>在云信管理后台查看应用的 appKey</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>account</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>帐号, 应用内唯一</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>token</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>帐号的 token, 用于建立连接</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>nosScenes</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    'chatroom'
                
                </td>
            

            <td class="description last"><p>nos文件存储全局配置，存储场景，实例有效，默认chatroom</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>nosSurvivalTime</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    Infinity
                
                </td>
            

            <td class="description last"><p>nos文件存储全局配置，存储有效时间，实例有效，默认Infinity 不得小于一天，单位秒</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>chatroomId</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>聊天室 id</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>chatroomAddresses</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;String></span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>聊天室地址列表</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>onconnect</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>连接建立后的回调, 会传入<a href="ChatroomInfo.html"><code>聊天室信息</code></a></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>onwillreconnect</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>即将重连的回调</p>
<ul>
<li>此时说明 SDK 已经断开连接, 请开发者在界面上提示用户连接已断开, 而且正在重新建立连接</li>
<li>此回调会收到一个对象, 包含额外的信息, 有以下字段<ul>
<li><code>duration</code>: 距离下次重连的时间</li>
<li><code>retryCount</code>: 重连尝试的次数</li>
</ul>
</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>ondisconnect</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>断开连接后的回调</p>
<ul>
<li>此时说明 SDK 处于断开状态, 开发者此时应该根据错误码提示相应的错误信息, 并且跳转到登录页面</li>
<li>此回调会收到一个对象, 包含错误的信息, 有以下字段<ul>
<li><code>code</code>: 出错时的错误码, 可能为空<ul>
<li><code>302</code>: 账号或者密码错误</li>
<li><code>'kicked'</code>: 被踢</li>
</ul>
</li>
</ul>
</li>
<li>当<code>code</code>为<code>'kicked'</code>的时候, 此对象会有以下字段<ul>
<li><code>reason</code>: 被踢的原因<ul>
<li><code>chatroomClosed</code>: 聊天室关闭了</li>
<li><code>managerKick</code>: 被管理员踢出</li>
<li><code>samePlatformKick</code>: 不允许同一个帐号重复登录同一个聊天室</li>
</ul>
</li>
<li><code>message</code>: 文字描述的被踢的原因</li>
</ul>
</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>onerror</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>发生错误的回调, 会传入<a href="NIMError.html"><code>错误</code></a>对象</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>onmsgs</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>收到消息的回调, 会传入<a href="ChatroomMessage.html"><code>消息</code></a>数组</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">var chatroom = new Chatroom({
    appKey: &#x27;appKey&#x27;,
    account: &#x27;account&#x27;,
    token: &#x27;token&#x27;,
    chatroomId: &#x27;chatroomId&#x27;,
    chatroomAddresses: [
        &#x27;address1&#x27;,
        &#x27;address2&#x27;
    ],
    onconnect: onChatroomConnect,
    onerror: onChatroomError,
    onwillreconnect: onChatroomWillReconnect,
    ondisconnect: onChatroomDisconnect,
    // 消息
    onmsgs: onChatroomMsgs
});
function onChatroomConnect(chatroomInfo) {
    console.log(&#x27;进入聊天室&#x27;, chatroomInfo);
}
function onChatroomWillReconnect(obj) {
    // 此时说明 &#x60;SDK&#x60; 已经断开连接, 请开发者在界面上提示用户连接已断开, 而且正在重新建立连接
    console.log(&#x27;即将重连&#x27;, obj);
}
function onChatroomDisconnect(error) {
    // 此时说明 &#x60;SDK&#x60; 处于断开状态, 开发者此时应该根据错误码提示相应的错误信息, 并且跳转到登录页面
    console.log(&#x27;连接断开&#x27;, error);
    if (error) {
        switch (error.code) {
        // 账号或者密码错误, 请跳转到登录页面并提示错误
        case 302:
            break;
        // 被踢, 请提示错误后跳转到登录页面
        case &#x27;kicked&#x27;:
            break;
        default:
            break;
        }
    }
}
function onChatroomError(error, obj) {
    console.log(&#x27;发生错误&#x27;, error, obj);
}
function onChatroomMsgs(msgs) {
    console.log(&#x27;收到聊天室消息&#x27;, msgs);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="audioToMp3"><span class="type-signature"></span>audioToMp3(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>将音频 url 转为 mp3</p>
<ul>
<li>此方法会返回一个新的 url</li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>url</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            

            

            <td class="description last"><p>url</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>转为 mp3 后的 url</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">String</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">var url = &#x27;http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xMTQwMzFfMTQ1MTg4ODk5MjMxMV9mNmI1Y2QyZC03N2UzLTQxNmUtYWY5NC1iODlhZGY4ZTYzYWQ=&#x27;;
var mp3Url = chatroom.audioToMp3({
    url: url
});
console.log(mp3Url);</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="connect"><span class="type-signature"></span>connect()</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>进入聊天室</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	
	<dt class="tag-see method-doc-label method-doc-details-label">See:</dt>
	<dd class="tag-see">
		<ul>
			<li><a href="Chatroom.html#disconnect"><code>disconnect</code></a></li>
			</ul>
	</dd>
	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.connect();</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="disconnect"><span class="type-signature"></span>disconnect()</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>退出聊天室</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	
	<dt class="tag-see method-doc-label method-doc-details-label">See:</dt>
	<dd class="tag-see">
		<ul>
			<li><a href="Chatroom.html#connect"><code>connect</code></a></li>
			</ul>
	</dd>
	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.disconnect();</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="drop"><span class="type-signature"></span>drop(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>清除聊天室队列</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            

            

            <td class="description last"><p>结果回调函数</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.drop({
  done: dropDone
})
function dropDone (error, obj, content) {
  console.log(&#x27;清除聊天室队列&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, obj, content);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="getChatroom"><span class="type-signature"></span>getChatroom(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>获取聊天室信息</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            

            

            <td class="description last"><p>结果回调函数, 成功时会额外附上<a href="ChatroomInfo.html"><code>聊天室信息</code></a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.getChatroom({
    done: getChatroomDone
});
function getChatroomDone(error, obj) {
    console.log(&#x27;获取聊天室信息&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, obj);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="getChatroomMembers"><span class="type-signature"></span>getChatroomMembers(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>获取聊天室成员列表</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>guest</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p><code>true</code>表示获取游客, <code>false</code>表示获取非游客成员</p>
<ul>
<li>游客列表按照游客进入聊天室的时间倒序排列</li>
<li>非游客（即固定成员）列表按照成为固定成员的时间倒序排列</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>onlyOnline</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description last"><p>当设置<code>guest=false</code>来获取非游客成员时, 默认会获取所有的固定成员, 包括不在线的, 可以设置<code>onlyOnline=true</code>来只获取在线的固定成员</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>time</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    0
                
                </td>
            

            <td class="description last"><p>分页用, 查找该时间戳之前的成员</p>
<ul>
<li>默认 0 代表当前服务器时间</li>
<li>获取游客时, 此字段填上次获取的最后一个游客的<code>enterTime</code></li>
<li>获取非游客时, 此字段填上次获取的最后一个非游客的<code>updateTime</code></li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>limit</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    100
                
                </td>
            

            <td class="description last"><p>分页用, 默认 100</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">done</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>结果回调函数, 成功时会额外附上<a href="ChatroomMember.html"><code>聊天室成员信息</code></a>列表</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.getChatroomMembers({
    guest: false,
    limit: 100,
    done: getChatroomMembersDone
});
function getChatroomMembersDone(error, obj) {
    console.log(&#x27;获取聊天室成员&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, obj.members);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="getChatroomMembersInfo"><span class="type-signature"></span>getChatroomMembersInfo(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>获取聊天室成员信息</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>accounts</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;String></span>



            
            </td>

            

            

            <td class="description last"><p>待查询的账号列表, 每次最多20个</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            

            

            <td class="description last"><p>结果回调函数, 成功时会额外附上<a href="ChatroomMember.html"><code>聊天室成员信息</code></a>列表</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.getChatroomMembersInfo({
    accounts: [&#x27;account1&#x27;, &#x27;account2&#x27;],
    done: getChatroomMembersInfoDone
});
function getChatroomMembersInfoDone(erorr, obj) {
    console.log(&#x27;获取聊天室成员信息&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, obj);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="getHistoryMsgs"><span class="type-signature"></span>getHistoryMsgs(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>获取聊天室历史消息</p>
<ul>
<li>获取从 timetag 对应的时间点往前的若干条数据</li>
<li>不填 timetag 的话默认为服务器当前时间</li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>timetag</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>时间戳</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>limit</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    100
                
                </td>
            

            <td class="description last"><p>limit, 默认 100</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>reverse</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description last"><p>默认<code>false</code>表示从<code>timetag</code>开始往前查找历史消息;</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>msgTypes</code></td>
            

            <td class="type">
            
                
<span class="param-type">StringArray</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    ['text', 'image', ...]
                
                </td>
            

            <td class="description last"><p>消息类型列表，默认全部消息类型</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.getHistoryMsgs({
    timetag: 1451393192478,
    limit: 100,
    done: getHistoryMsgsDone
});
function getHistoryMsgsDone(error, obj) {
    console.log(&#x27;获取聊天室历史&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, obj.msgs);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="kickChatroomMember"><span class="type-signature"></span>kickChatroomMember(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>踢聊天室成员</p>
<ul>
<li>当有人被<a href="Chatroom.html#kickChatroomMember"><code>踢出聊天室</code></a>时, 所有聊天室成员会收到类型为<a href="ChatroomMessage.html#.type"><code>'<code>kickMember</code>'</code></a>的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>。</li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>account</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>待踢的账号</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>custom</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>扩展字段, 如果填了, 那么其它聊天室成员收到的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>的<code>attach.custom</code>的值为此字段, 被踢的人收到的<code>ondisconnect</code>回调接收的参数的<code>custom</code>的值为此字段</p>
<ul>
<li>推荐使用<code>JSON</code>格式构建, 非<code>JSON</code>格式的话, Web端会正常接收, 但是会被其它端丢弃</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>结果回调函数</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.kickChatroomMember({
    account: &#x27;account&#x27;,
    done: kickChatroomMemberDone
});
function kickChatroomMember(error, obj) {
    console.log(&#x27;踢人&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, obj);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="markChatroomBlacklist"><span class="type-signature"></span>markChatroomBlacklist(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>设置聊天室黑名单</p>
<ul>
<li>被加入黑名单的人将不能进入此聊天室</li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>account</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>待设置的账号</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>isAdd</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p><code>true</code>表示添加, <code>false</code>表示移除</p>
<ul>
<li>当有人被<a href="Chatroom.html#markChatroomBlacklist"><code>加入黑名单</code></a>时, 所有聊天室成员会收到类型为<code><code>'blackMember'</code></code>的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>。</li>
<li>当有人被<a href="Chatroom.html#markChatroomBlacklist"><code>移除黑名单</code></a>时, 所有聊天室成员会收到类型为<code><code>'blackMember'</code></code>的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>。</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>custom</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>扩展字段, 如果填了, 那么其它聊天室成员收到的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>的<code>attach.custom</code>的值为此字段</p>
<ul>
<li>推荐使用<code>JSON</code>格式构建, 非<code>JSON</code>格式的话, Web端会正常接收, 但是会被其它端丢弃</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>结果回调函数, 成功时会额外附上<a href="ChatroomMember.html"><code>聊天室成员信息</code></a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.markChatroomBlacklist({
    account: &#x27;account&#x27;,
    isAdd: true,
    done: markChatroomBlacklistDone
});
function markChatroomBlacklistDone(error, obj) {
    console.log(&#x27;添加聊天室黑名单&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, obj.member);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="markChatroomCommonMember"><span class="type-signature"></span>markChatroomCommonMember(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>设置聊天室普通成员</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>account</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>待设置的账号</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>isAdd</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>是否加为普通成员</p>
<ul>
<li>当有人被<a href="Chatroom.html#markChatroomCommonMember"><code>加为普通成员</code></a>时, 所有聊天室成员会收到类型为<code><code>'addCommon'</code></code>的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>。</li>
<li>当有人被<a href="Chatroom.html#markChatroomCommonMember"><code>移除普通成员</code></a>时, 所有聊天室成员会收到类型为<code><code>'removeCommon'</code></code>的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>。</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>level</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    0
                
                </td>
            

            <td class="description last"><p>等级</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>custom</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>扩展字段, 如果填了, 那么其它聊天室成员收到的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>的<code>attach.custom</code>的值为此字段</p>
<ul>
<li>推荐使用<code>JSON</code>格式构建, 非<code>JSON</code>格式的话, Web端会正常接收, 但是会被其它端丢弃</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>结果回调函数</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.markChatroomCommonMember({
    account: &#x27;account&#x27;,
    level: 0,
    done: markChatroomCommonMemberDone
});
function markChatroomCommonMemberDone(error) {
    console.log(&#x27;设置聊天室普通成员&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="markChatroomGaglist"><span class="type-signature"></span>markChatroomGaglist(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>设置聊天室禁言名单</p>
<ul>
<li>被加入禁言名单的人将不能在该聊天室发送消息</li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>account</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>待设置的账号</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>isAdd</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p><code>true</code>表示添加, <code>false</code>表示移除</p>
<ul>
<li>当有人被<a href="Chatroom.html#markChatroomGaglist"><code>加入禁言名单</code></a>时, 所有聊天室成员会收到类型为<code><code>'gagMember'</code></code>的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>。</li>
<li>当有人被<a href="Chatroom.html#markChatroomGaglist"><code>移除禁言名单</code></a>时, 所有聊天室成员会收到类型为<code><code>'ungagMember'</code></code>的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>。</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>custom</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>扩展字段, 如果填了, 那么其它聊天室成员收到的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>的<code>attach.custom</code>的值为此字段</p>
<ul>
<li>推荐使用<code>JSON</code>格式构建, 非<code>JSON</code>格式的话, Web端会正常接收, 但是会被其它端丢弃</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>结果回调函数, 成功时会额外附上<a href="ChatroomMember.html"><code>聊天室成员信息</code></a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.markChatroomGaglist({
    account: &#x27;account&#x27;,
    isAdd: true,
    done: markChatroomGaglistDone
});
function markChatroomGaglistDone(error, obj) {
    console.log(&#x27;添加聊天室禁言名单&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, obj.member);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="markChatroomIdentity"><span class="type-signature"></span>markChatroomIdentity(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>设置聊天室成员身份</p>
<ul>
<li>管理员可以<a href="Chatroom.html#markChatroomCommonMember"><code>设置聊天室普通成员</code></a>, <a href="Chatroom.html#markChatroomBlacklist"><code>设置聊天室黑名单</code></a>, <a href="Chatroom.html#markChatroomGaglist"><code>设置聊天室禁言名单</code></a>, <a href="Chatroom.html#kickChatroomMember"><code>踢聊天室成员</code></a></li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>account</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>待设置的账号</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>identity</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>待设置的身份，如果不是以下身份则默认设置为普通成员</p>
<ul>
<li><code>'manager'</code> (管理员)</li>
<li><code>'common'</code> (普通成员)</li>
<li><code>'black'</code> (拉黑)</li>
<li><code>'mute'</code> (禁言)</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>isAdd</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p><code>true</code>表示添加, <code>false</code>表示移除</p>
<ul>
<li>当有人被<a href="Chatroom.html#markChatroomManager"><code>加为管理员</code></a>时, 所有聊天室成员会收到类型为<code><code>'addManager'</code></code>的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>。</li>
<li>当有人被<a href="Chatroom.html#markChatroomManager"><code>移除管理员</code></a>时, 所有聊天室成员会收到类型为<code><code>'removeManager'</code></code>的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>。</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>custom</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>扩展字段, 如果填了, 那么其它聊天室成员收到的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>的<code>attach.custom</code>的值为此字段</p>
<ul>
<li>推荐使用<code>JSON</code>格式构建, 非<code>JSON</code>格式的话, Web端会正常接收, 但是会被其它端丢弃</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>结果回调函数, 成功时会额外附上<a href="ChatroomMember.html"><code>聊天室成员信息</code></a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.markChatroomIdentity({
    account: &#x27;account&#x27;,
    identity: &#x27;common&#x27;,
    isAdd: true,
    done: markChatroomIdentityDone
});
function markChatroomIdentityDone(error, obj) {
    console.log(&#x27;设置聊天室成员身份&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, obj.member);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="markChatroomManager"><span class="type-signature"></span>markChatroomManager(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>设置聊天室管理员</p>
<ul>
<li>管理员可以<a href="Chatroom.html#markChatroomCommonMember"><code>设置聊天室普通成员</code></a>, <a href="Chatroom.html#markChatroomBlacklist"><code>设置聊天室黑名单</code></a>, <a href="Chatroom.html#markChatroomGaglist"><code>设置聊天室禁言名单</code></a>, <a href="Chatroom.html#kickChatroomMember"><code>踢聊天室成员</code></a></li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>account</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>待设置的账号</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>isAdd</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p><code>true</code>表示添加, <code>false</code>表示移除</p>
<ul>
<li>当有人被<a href="Chatroom.html#markChatroomManager"><code>加为管理员</code></a>时, 所有聊天室成员会收到类型为<code><code>'addManager'</code></code>的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>。</li>
<li>当有人被<a href="Chatroom.html#markChatroomManager"><code>移除管理员</code></a>时, 所有聊天室成员会收到类型为<code><code>'removeManager'</code></code>的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>。</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>custom</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>扩展字段, 如果填了, 那么其它聊天室成员收到的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>的<code>attach.custom</code>的值为此字段</p>
<ul>
<li>推荐使用<code>JSON</code>格式构建, 非<code>JSON</code>格式的话, Web端会正常接收, 但是会被其它端丢弃</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>结果回调函数, 成功时会额外附上<a href="ChatroomMember.html"><code>聊天室成员信息</code></a></p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.markChatroomManager({
    account: &#x27;account&#x27;,
    isAdd: true,
    done: markChatroomManagerDone
});
function markChatroomManagerDone(error, obj) {
    console.log(&#x27;添加聊天室管理员&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, obj.member);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="packFileDownloadName"><span class="type-signature"></span>packFileDownloadName(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>修改图片下载的名字</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>url</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            

            

            <td class="description last"><p>原图 url</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>name</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            

            

            <td class="description last"><p>下载的名字</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>修改图片下载名字后的图片 url</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">String</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">var url = &#x27;http://nim.nos.netease.com/MTAxMTAwMg==/bmltYV8xNDc5OTNfMTQ0MzE0NTgyNDI0M184YjFkYTMwMS02NjcxLTRiYjktYTUwZC04ZTVlZjZlNzZjMzA=&#x27;;
var nameUrl = chatroom.packFileDownloadName({
    url: url,
    name: &#x27;测试.jpg&#x27;
});
console.log(nameUrl);</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="peak"><span class="type-signature"></span>peak(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>获取聊天室队列中第一个元素</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            

            

            <td class="description last"><p>结果回调函数</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.peak({
  done: peakDone
})
function peakDone (error, obj, content) {
  console.log(&#x27;获取聊天室队列中第一个元素&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, obj, content);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="previewFile"><span class="type-signature"></span>previewFile(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>预览文件</p>
<ul>
<li>开发者可以预览文件, 支持以下几种场景<ul>
<li>通过参数<code>fileInput</code>传入文件选择 dom 节点或者节点 ID, SDK 会读取该节点下的文件, 在上传完成前请不要操作该节点下的文件</li>
<li>通过参数<code>blob</code>传入 Blob 对象</li>
<li>通过参数<code>dataURL</code>传入包含 MIME type 和 base64 数据的 data URL, 此用法需要浏览器支持 Blob</li>
</ul>
</li>
<li>SDK会将文件上传到文件服务器, 然后将拿到的文件对象在<code>done</code>回调中传给开发者, 文件对象有以下几种<ul>
<li><a href="Image.html"><code>图片对象</code></a></li>
<li><a href="Audio.html"><code>音频对象</code></a></li>
<li><a href="Video.html"><code>视频对象</code></a></li>
<li><a href="File.html"><code>文件对象</code></a></li>
</ul>
</li>
<li>开发者在拿到文件对象之后, 可以调用<a href="Chatroom.html#sendFile"><code>发送文件消息</code></a>来发送文件消息。</li>
<li>文件大小限制为最大 100M<ul>
<li>高级浏览器会在上传前就检测文件大小</li>
<li>IE8/IE9 会在上传完成后检测文件大小</li>
</ul>
</li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>type</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>文件过滤器</p>
<ul>
<li>image会过滤掉非图片的文件, audio过滤掉非音频, video会过滤掉非视频的文件</li>
<li>IE8/IE9 不支持文件过滤</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>fileInput</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Node</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>文件选择 dom 节点或者节点 ID, SDK 会读取该节点下的文件, 在上传完成前请不要操作该节点下的文件</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>blob</code></td>
            

            <td class="type">
            
                
<span class="param-type">Blob</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Blob 对象</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>dataURL</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>包含 MIME type 和 base64 数据的 data URL</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>uploadprogress</code></td>
            

            <td class="type">
            
                
<span class="param-type">uploadprogress</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>上传进度, ie9以下不支持上传进度</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>nosScenes</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>存储场景，不传默认全局实例配置</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>nosSurvivalTime</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>存储有效时间，传默认全局实例配置 不得小于一天，单位秒</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">done</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>结果回调函数, 成功时会收到文件对象, 请参考</p>
<ul>
<li><a href="Image.html"><code>图片对象</code></a></li>
<li><a href="Audio.html"><code>音频对象</code></a></li>
<li><a href="Video.html"><code>视频对象</code></a></li>
<li><a href="File.html"><code>文件对象</code></a></li>
</ul></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.previewFile({
    type: &#x27;image&#x27;,
    fileInput: fileInput,
    uploadprogress: function(obj) {
        console.log(&#x27;文件总大小: &#x27; + obj.total + &#x27;bytes&#x27;);
        console.log(&#x27;已经上传的大小: &#x27; + obj.loaded + &#x27;bytes&#x27;);
        console.log(&#x27;上传进度: &#x27; + obj.percentage);
        console.log(&#x27;上传进度文本: &#x27; + obj.percentageText);
    },
    done: function(error, file) {
        console.log(&#x27;上传image&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;));
        // show file to the user
        if (!error) {
            var msg = chatroom.sendFile({
                scene: &#x27;p2p&#x27;,
                to: &#x27;account&#x27;,
                file: file,
                done: sendChatroomMsgDone
            });
            console.log(&#x27;正在发送聊天室image消息, id=&#x27; + msg.idClient);
        }
    }
});</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="queueChange"><span class="type-signature"></span>queueChange(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>批量更新聊天室队列</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>elementMap</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            

            

            <td class="description last"><p>批量更新元素的key-value对，key/value分别是elementKey和elementValue（elementKey限制128字节,elementValue限制4096字节），一次最多更新100个</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>needNotify</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            

            

            <td class="description last"><p>是否需要发送广播通知，可选参数，不传默认false，当设置为 true 时，所有聊天室成员会收到类型为<a href="ChatroomMessage.html#.type"><code><code>'updateQueue'</code></code></a>的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>。</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>notifyExt</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            

            

            <td class="description last"><p>通知中的自定义字段，长度限制2048</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            

            

            <td class="description last"><p>结果回调函数</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.queueChange({
  elementMap: {
    elementKey1: newElementValue
  },
  transient: true,
  notifyExt: &#x27;queueChange&#x27;,
  done: queueChangeDone
})
function queueChangeDone (error, obj, content) {
  console.log(&#x27;批量更新聊天室队列&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, obj, content);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="queueList"><span class="type-signature"></span>queueList(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>获取聊天室队列列表</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            

            

            <td class="description last"><p>结果回调函数</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.queueList({
  done: queueListDone
})
function queueListDone (error, obj, content) {
  console.log(&#x27;获取聊天室队列列表&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, obj, content);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="queueOffer"><span class="type-signature"></span>queueOffer(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>新加(更新)队列元素</p>
<ul>
<li>当<a href="Chatroom.html#queueOffer"><code>新加(更新)队列元素</code></a>时, 所有聊天室成员会收到类型为<a href="ChatroomMessage.html#.type"><code><code>'updateQueue'</code></code></a>的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>。如果elementKey对应的元素已经在队列中存在了，那就是更新操作，如果不存在，就放到队列尾部.</li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>elementKey</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            

            

            <td class="description last"><p>新元素的UniqKey，长度限制128字节</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>elementValue</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            

            

            <td class="description last"><p>新元素内容，长度限制4096字节</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>transient</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            

            

            <td class="description last"><p>可选参数，不传默认false，当提交这个新元素的用户从聊天室掉线或退出的时候，是否需要删除这个元素。</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            

            

            <td class="description last"><p>结果回调函数</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.queueOffer({
  elementKey: ‘elementKey1’,
  elementValue: ‘elementValue1’,
  transient: true,
  done: queueOfferDone
})
function queueOfferDone (error, obj, content) {
  console.log(&#x27;新加(更新)队列元素&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, obj, content);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="queuePoll"><span class="type-signature"></span>queuePoll(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>删除队列元素</p>
<ul>
<li>当<a href="Chatroom.html#queuePoll"><code>删除队列元素</code></a>时, 所有聊天室成员会收到类型为<a href="ChatroomMessage.html#.type"><code><code>'updateQueue'</code></code></a>的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>。</li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>elementKey</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            

            

            <td class="description last"><p>需要取出的元素的UniqKey, 传空传表示取出第一个元素</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            

            

            <td class="description last"><p>结果回调函数</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.queuePoll({
  elementKey: ‘elementKey1’,
  done: queuePollDone
})
function queuePollDone (error, obj, content) {
  console.log(&#x27;删除队列元素&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, obj, content);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="sendCustomMsg"><span class="type-signature"></span>sendCustomMsg(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>发送自定义消息</p>
<ul>
<li>自定义消息是<a href="ChatroomMessage.html#.type"><code>消息类型</code></a>的一种</li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>content</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>自定义消息的消息内容, 推荐使用JSON格式构建</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>resend</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>是否是重发</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>idClient</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>如果是重发, 那么需要带上之前生成的idClient来标记这条消息</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>custom</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>扩展字段</p>
<ul>
<li>推荐使用<code>JSON</code>格式构建, 非<code>JSON</code>格式的话, Web端会正常接收, 但是会被其它端丢弃</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>fromNick</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>发送方的昵称</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">done</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>结果回调函数</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p><a href="ChatroomMessage.html"><code>消息</code></a></p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Message</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">var value = Math.ceil(Math.random()*3);
var content = {
    type: 1,
    data: {
        value: value
    }
};
var msg = chatroom.sendCustomMsg({
    content: JSON.stringify(content),
    done: sendChatroomMsgDone
});
console.log(&#x27;正在发送聊天室自定义消息, id=&#x27; + msg.idClient);</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="sendFile"><span class="type-signature"></span>sendFile(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>发送文件消息</p>
<ul>
<li>文件消息是<a href="ChatroomMessage.html#.type"><code>消息类型</code></a>的一种</li>
<li>开发者可以直接发送文件消息<ul>
<li>支持以下几种场景<ul>
<li>通过参数<code>fileInput</code>传入文件选择 dom 节点或者节点 ID, SDK 会读取该节点下的文件, 在上传完成前请不要操作该节点下的文件</li>
<li>通过参数<code>blob</code>传入 Blob 对象</li>
<li>通过参数<code>dataURL</code>传入包含 MIME type 和 base64 数据的 data URL, 此用法需要浏览器支持 Blob</li>
</ul>
</li>
<li>SDK会先将文件上传到文件服务器, 然后把拿到的文件对象在<code>uploaddone</code>回调中传给用户, 然后将其拼装成文件消息发送出去。</li>
</ul>
</li>
<li>开发者也可以先<a href="Chatroom.html#previewFile"><code>预览文件</code></a>来获取文件对象, 然后调用此接口发送文件消息。<ul>
<li>通过参数<code>file</code>传入文件</li>
</ul>
</li>
<li>直接发送文件消息的话会在<code>beforesend</code>回调里面传入SDK生成的<code>idClient</code>, 如果先预览文件再发送, 那么此接口会直接返回<code>idClient</code></li>
<li>参数<code>type</code>指定了要发送的文件类型, 包括图片、音频、视频和普通文件, 对应的值分别为<code>'image'</code>、<code>'audio'</code>、<code>'video'</code>和<code>'file'</code>, 不传默认为<code>'file'</code>。</li>
<li>图片、音频、视频和普通文件的区别在于具体的文件信息不一样, 具体字段请参考<ul>
<li><a href="Image.html"><code>图片对象</code></a></li>
<li><a href="Audio.html"><code>音频对象</code></a></li>
<li><a href="Video.html"><code>视频对象</code></a></li>
<li><a href="File.html"><code>文件对象</code></a></li>
</ul>
</li>
<li>文件大小限制为最大100M<ul>
<li>高级浏览器会在上传前就检测文件大小</li>
<li>IE8和IE9会在上传完成后检测文件大小</li>
</ul>
</li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>type</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>文件过滤器,<br>                                                         <code>'image'</code>会过滤掉非图片的文件, <code>'audio'</code>过滤掉非音频, <code>'video'</code>会过滤掉非视频的文件,<br>                                                         IE8/IE9 不支持文件过滤</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>fileInput</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">Node</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>文件选择 dom 节点或者节点 ID, SDK 会读取该节点下的文件, 在上传完成前请不要操作该节点下的文件</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>blob</code></td>
            

            <td class="type">
            
                
<span class="param-type">Blob</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>Blob 对象</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>dataURL</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>MIME type 和 base64 数据的 data URL</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>file</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>文件对象, 开发者可以通过<a href="Chatroom.html#previewFile"><code>预览文件</code></a>拿到文件对象</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>wxFilePath</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>仅供微信小程序使用, 通过 wx.chooseImage 或者 wx.startRecord 拿到的临时文件路径</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>resend</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description last"><p>是否是重发</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>beginupload</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>开始上传图片的回调</p>
<ul>
<li>如果开发者传入 fileInput, 在此回调之前不能修改 fileInput</li>
<li>在此回调之后可以取消图片上传, 此回调会接收一个参数 <code>upload</code>, 调用 <code>upload.abort();</code> 来取消文件上传</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>uploadprogress</code></td>
            

            <td class="type">
            
                
<span class="param-type">uploadprogress</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>上传进度, IE9以下不支持上传进度</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>uploaddone</code></td>
            

            <td class="type">
            
                
<span class="param-type">uploaddone</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>上传完成回调</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>beforesend</code></td>
            

            <td class="type">
            
                
<span class="param-type">beforesend</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>发送文件消息之前的回调函数</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>resend</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>是否是重发</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>idClient</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>如果是重发, 那么需要带上之前生成的idClient来标记这条消息</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>custom</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>扩展字段</p>
<ul>
<li>推荐使用<code>JSON</code>格式构建, 非<code>JSON</code>格式的话, Web端会正常接收, 但是会被其它端丢弃</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>fromNick</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>发送方的昵称</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>nosScenes</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>存储场景，不传默认全局实例配置</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>nosSurvivalTime</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>存储有效时间，传默认全局实例配置 不得小于一天，单位秒</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">done</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>结果回调函数</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <ul>
<li>如果提供了参数fileInput, 那么先上传文件到服务器再发送, 不会返回<a href="ChatroomMessage.html"><code>消息</code></a>, 会在beforesend里面返回<a href="ChatroomMessage.html"><code>消息</code></a>.</li>
<li>如果提供了参数file, 那么直接发送文件消息, 返回<a href="ChatroomMessage.html"><code>消息</code></a></li>
</ul>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>
|

<span class="param-type">Message</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.sendFile({
    type: &#x27;image&#x27;,
    fileInput: fileInput,
    uploadprogress: function(obj) {
        console.log(&#x27;文件总大小: &#x27; + obj.total + &#x27;bytes&#x27;);
        console.log(&#x27;已经上传的大小: &#x27; + obj.loaded + &#x27;bytes&#x27;);
        console.log(&#x27;上传进度: &#x27; + obj.percentage);
        console.log(&#x27;上传进度文本: &#x27; + obj.percentageText);
    },
    uploaddone: function(error, file) {
        console.log(&#x27;上传&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, file);
    },
    beforesend: function(msg) {
        console.log(&#x27;正在发送聊天室image消息, id=&#x27; + msg.idClient);
    },
    done: sendChatroomMsgDone
});</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="sendGeo"><span class="type-signature"></span>sendGeo(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>发送地理位置消息</p>
<ul>
<li>地理位置消息是<a href="ChatroomMessage.html#.type"><code>消息类型</code></a>的一种, <code>geo</code>参数请参考<a href="Geo.html"><code>地理位置对象</code></a></li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>geo</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>地理位置对象</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>lng</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>



            
            </td>

            

            

            <td class="description last"><p>经度</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>lat</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>



            
            </td>

            

            

            <td class="description last"><p>纬度</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>title</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            

            

            <td class="description last"><p>地址描述</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>resend</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>是否是重发</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>idClient</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>如果是重发, 那么需要带上之前生成的idClient来标记这条消息</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>custom</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>扩展字段</p>
<ul>
<li>推荐使用<code>JSON</code>格式构建, 非<code>JSON</code>格式的话, Web端会正常接收, 但是会被其它端丢弃</li>
</ul></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p><a href="ChatroomMessage.html"><code>消息</code></a></p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Message</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">var msg = chatroom.sendGeo({
    scene: &#x27;p2p&#x27;,
    to: &#x27;account&#x27;,
    geo: {
        lng: &#x27;116.3833&#x27;,
        lat: &#x27;39.9167&#x27;,
        title: &#x27;Beijing&#x27;
    },
    done: sendChatroomMsgDone
});
console.log(&#x27;正在发送聊天室geo消息, id=&#x27; + msg.idClient);</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="sendText"><span class="type-signature"></span>sendText(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>发送文本消息</p>
<ul>
<li>文本消息是消息的一种, 请参考<a href="ChatroomMessage.html"><code>消息</code></a></li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>text</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>文本消息内容</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>resend</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>是否是重发</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>idClient</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>如果是重发, 那么需要带上之前生成的idClient来标记这条消息</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>custom</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>扩展字段</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>clientAntiSpam</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description last"><p>是否需要过客户端反垃圾</p>
<ul>
<li>推荐使用<code>JSON</code>格式构建, 非<code>JSON</code>格式的话, Web端会正常接收, 但是会被其它端丢弃</li>
</ul></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">done</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>结果回调函数</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p><a href="ChatroomMessage.html"><code>消息</code></a></p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Message</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">var msg = chatroom.sendText({
    text: &#x27;hello&#x27;,
    done: sendChatroomMsgDone
});
console.log(&#x27;正在发送聊天室text消息, id=&#x27; + msg.idClient);
function sendChatroomMsgDone(error, msg) {
    console.log(&#x27;发送聊天室&#x27; + msg.type + &#x27;消息&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;) + &#x27;, id=&#x27; + msg.idClient, error, msg);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="sendTipMsg"><span class="type-signature"></span>sendTipMsg(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>发送提醒消息</p>
<ul>
<li>提醒消息是<a href="ChatroomMessage.html#.type"><code>消息类型</code></a>的一种</li>
<li>提醒消息用于会话内的状态提醒，如进入会话时出现的欢迎消息，或者会话命中敏感词后的提示消息等等.</li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>tip</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>提醒内容</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>resend</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>是否是重发</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>idClient</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>如果是重发, 那么需要带上之前生成的idClient来标记这条消息</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>custom</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>扩展字段</p>
<ul>
<li>推荐使用<code>JSON</code>格式构建, 非<code>JSON</code>格式的话, Web端会正常接收, 但是会被其它端丢弃</li>
</ul></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p><a href="ChatroomMessage.html"><code>消息</code></a></p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Message</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">var msg = chatroom.sendTipMsg({
    scene: &#x27;p2p&#x27;,
    to: &#x27;account&#x27;,
    tip: &#x27;tip content&#x27;,
    done: sendChatroomMsgDone
});
console.log(&#x27;正在发送聊天室提醒消息, id=&#x27; + msg.idClient);</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="setOptions"><span class="type-signature"></span>setOptions(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>更新聊天室配置, 参数格式跟 <a href="Chatroom.html#.getInstance"><code>Chatroom.getInstance</code></a> 保持一致</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>token</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            

            

            <td class="description last"><p>帐号的 token, 用于建立连接</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">// 更新 token 的例子
chatroom.setOptions({
    token: &#x27;newToken&#x27;
});</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="updateChatroom"><span class="type-signature"></span>updateChatroom(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>更新聊天室信息</p>
<ul>
<li>当<a href="Chatroom.html#updateChatroom"><code>更新聊天室</code></a>时, 所有聊天室成员会收到类型为<a href="ChatroomMessage.html#.type"><code><code>'updateChatroom'</code></code></a>的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>。</li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>chatroom</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>待更新的聊天室信息</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>name</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>聊天室名字</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>announcement</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>聊天室公告</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>broadcastUrl</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>直播地址</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>custom</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>扩展字段</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>queuelevel</code></td>
            

            <td class="type">
            
                
<span class="param-type">Integer</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>队列管理权限：0:所有人都有权限变更队列，1:只有主播管理员才能操作变更</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>needNotify</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>是否需要下发对应的通知消息</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>custom</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>对应的通知消息的扩展字段</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>结果回调函数</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.updateChatroom({
  chatroom: {
    name: &#x27;newName&#x27;,
    announcement: &#x27;newAnnouncement&#x27;,
    broadcastUrl: &#x27;newBroadcastUrl&#x27;,
    custom: &#x27;newCustom&#x27;,
    queuelevel: &#x27;newQueuelevel&#x27;,
  },
  needNotify: true,
  custom: &#x27;biu&#x27;,
  done: updateChatroomDone
})
function updateChatroomDone () {
  console.log(&#x27;更新聊天室信息&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, obj);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="updateChatroomMemberTempMute"><span class="type-signature"></span>updateChatroomMemberTempMute(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>设置聊天室临时禁言</p>
<ul>
<li>当有人被<a href="Chatroom.html#updateChatroomMemberTempMute"><code>设置聊天室临时禁言</code></a>时，所有聊天室成员会收到类型为<a href="ChatroomMessage.html#.type"><code><code>'addTempMute' or 'removeTempMute'</code></code></a>的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>。</li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>account</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            

            

            <td class="description last"><p>帐号</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>duration</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>



            
            </td>

            

            

            <td class="description last"><p>禁言时长，单位秒，传0表示解除禁言</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>needNotify</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            

            

            <td class="description last"><p>是否需要下发对应的通知消息</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>custom</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            

            

            <td class="description last"><p>对应的通知消息的扩展字段</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.updateChatroomMemberTempMute({
  account: &#x27;account&#x27;,
  duration: 60,
  needNotify: true,
  custom: &#x27;biu&#x27;,
  done: updateChatroomMemberTempMuteDone
})
function updateChatroomMemberTempMuteDone(error, obj) {
  console.log(&#x27;设置聊天室临时禁言&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, obj);
}</pre>


    
</dd>

        
            
<hr>
<dt>
    <h4 class="name" id="updateMyChatroomMemberInfo"><span class="type-signature"></span>updateMyChatroomMemberInfo(options)</h4>
    
    
</dt>
<dd>

    
    <div class="description">
        <p>更新自己在聊天室内的信息</p>
<ul>
<li>当<a href="Chatroom.html#updateMyChatroomMemberInfo"><code>更新自己在聊天室内的信息</code></a>时, 所有聊天室成员会收到类型为<a href="ChatroomMessage.html#.type"><code><code>'updateMemberInfo'</code></code></a>的<a href="ChatroomMessage.html"><code>聊天室通知消息</code></a>。</li>
</ul>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last"><p>配置参数</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>member</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>待更新的成员信息</p>
                <h6 class="method-params-label method-subparams-label">Properties</h6>
                

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>nick</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>聊天室内的昵称</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>avatar</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>聊天室内的头像</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>custom</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>第三方扩展字段</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    

        <tr>
            
                <td class="name"><code>needNotify</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>是否需要下发对应的通知消息</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>custom</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>对应的通知消息的扩展字段</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>needSave</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>可选，默认false，是否支持nick,avator和custom字段的持久化（固定成员有效）</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>结果回调函数</p></td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Void</span>



    </dd>
</dl>


        

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">chatroom.updateMyChatroomMemberInfo({
  member: {
    nick: &#x27;newNick&#x27;,
    avatar: &#x27;newAvatar&#x27;,
    custom: &#x27;newCustom&#x27;,
  },
  needNotify: true,
  needSave: true,
  custom: &#x27;biu&#x27;,
  done: updateMyChatroomMemberInfoDone
})
function updateMyChatroomMemberInfoDone (error, obj) {
  console.log(&#x27;更新自己在聊天室内的信息&#x27; + (!error?&#x27;成功&#x27;:&#x27;失败&#x27;), error, obj);
}</pre>


    
</dd>

        </dl>
    

    

    
</article>

</section>




		</div>
	</div>

	<div class="clearfix"></div>

	
		<div class="col-md-3">
			<div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
		</div>
	

</div>
</div>


    <div class="modal fade" id="searchResults">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title">Search results</h4>
          </div>
          <div class="modal-body"></div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
          </div>
        </div><!-- /.modal-content -->
      </div><!-- /.modal-dialog -->
    </div>


<footer>


<span class="jsdoc-message">
	Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
	
		on 2020-05-11T17:02:55+08:00
	
	using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
</footer>

<script src="scripts/docstrap.lib.js"></script>
<script src="scripts/toc.js"></script>

    <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>


<script>
$( function () {
	$( "[id*='$']" ).each( function () {
		var $this = $( this );

		$this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
	} );

	$( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
		var $this = $( this );

		var example = $this.find( "code" );
		exampleText = example.html();
		var lang = /{@lang (.*?)}/.exec( exampleText );
		if ( lang && lang[1] ) {
			exampleText = exampleText.replace( lang[0], "" );
			example.html( exampleText );
			lang = lang[1];
		} else {
			var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
			lang = langClassMatch ? langClassMatch[1] : "javascript";
		}

		if ( lang ) {

			$this
			.addClass( "sunlight-highlight-" + lang )
			.addClass( "linenums" )
			.html( example.html() );

		}
	} );

	Sunlight.highlightAll( {
		lineNumbers : false,
		showMenu : true,
		enableDoclinks : true
	} );

	$.catchAnchorLinks( {
        navbarOffset: 10
	} );
	$( "#toc" ).toc( {
		anchorName  : function ( i, heading, prefix ) {
			return $( heading ).attr( "id" ) || ( prefix + i );
		},
		selectors   : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
		showAndHide : false,
		smoothScrolling: true
	} );

	$( "#main span[id^='toc']" ).addClass( "toc-shim" );
	$( '.dropdown-toggle' ).dropdown();

    $( "table" ).each( function () {
      var $this = $( this );
      $this.addClass('table');
    } );

} );
</script>



<!--Navigation and Symbol Display-->


<!--Google Analytics-->



    <script type="text/javascript">
        $(document).ready(function() {
            SearcherDisplay.init();
        });
    </script>


</body>
</html>